#!/usr/bin/env python
# encoding: utf-8

import re


# 电话
RE_PHONE = re.compile(r'^((0\d{2,3}-\d{7,8})|(1[345789]\d{9}))$')

# 18 位身份证号
RE_ID_CARD = re.compile(r'^([1-9]\d{5}[12]\d{3}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])\d{3}[0-9xX])$')

# 座机
RE_TELEPHONE = re.compile(r'^((400[0-9]{7})|(800[0-9]{7})|(0[0-9]{2,3}-?[0-9]{7,8})|(1[02][0-9]{3,6})|(9[0-9]{4}))$')

# 手机
RE_MOBILEPHONE = re.compile(r'^(?=\d{11}$)^1(?:3\d|4[57]|5[^4\D]|66|7[^249\D]|8\d|9[89])\d{8}$')

# 注册号
RE_REGISTER_ID = re.compile(r'[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}')

# 域名
RE_DOMAIN = re.compile(r'^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$')

# email
RE_EMAIL = re.compile(r'[^@]+@[^@]+\.[^@]+')
